package com.netease.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.netease.domain.User;
import com.netease.domain.User_Commodity;
import com.netease.mapper.UserCommodityMapper;

@Service
public class UserCommodityServiceImpl implements UserCommodityService {
	@Autowired
	private UserCommodityMapper UserCommodityMapper;

	@Override
	public User getUserByUCId(String uc_id) {
		return UserCommodityMapper.getUserByUCId(uc_id);
	}
	
	@Override
	public List<User_Commodity> findAll() {
		return UserCommodityMapper.findAll();
	}
	
	@Override
	public List<User_Commodity> findAllByUserId(String user_id) {
		return UserCommodityMapper.findAllByUserId(user_id);
	}

	@Override
	public User_Commodity findOne(String id) {
		return UserCommodityMapper.findOne(id);
	}
	
	@Override
	public User_Commodity findOneByCommodityId(String commodityId) {
		return UserCommodityMapper.findOneByCommodityId(commodityId);
	}

	@Transactional
	public void save(User_Commodity info) {
		UserCommodityMapper.save(info);
	}

	@Override
	public int findCount() {
		return UserCommodityMapper.findCount();
	}
}
